Python in the Browser

Posted on June 21, 2022 in Python

Python code embedded in html which samples random Austrian lottery numbers.
Also prints the date and writes into labeled elements.
Bear in mind that this is just a simple static website :)
Uses PyScript. Check it out for some examples.

Today is


import datetime as dt from random import sample pyscript.write('today', dt.date.today().strftime('%A %B %d, %Y')) pyscript.write('lotto', f'{sample(range(1,46), 6)}')